#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPixmap>
#include <QBitmap>
#include "filecontrol.h"
#include <QDebug>
#include <QListWidgetItem>
#include "mediacontrol.h"
#include <QtNetwork>
#include <QStringList>
#include <QList>
#include <QTreeWidgetItem>
#include "filesetwidget.h"

namespace Ui {
class Widget;
}


class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    void add_PlayerList(void);
    ~Widget();

private slots:
    void readPendingDatagrams();
    void FTP_addList_Music(QStringList mediaName);
    void on_mediaList_itemDoubleClicked(QTreeWidgetItem *item, int column);
    void on_next_clicked();
    void on_previous_clicked();
    void on_play_stop_toggled(bool checked);
    void updateSlider(qint64 time);
    void setVol(int vol);
    void on_adjVol_toggled(bool checked);
    void on_setting_clicked();
    void setFTPParameter(QString host,int port,QString userName,QString password,QString path);
    void setLocationPath(QString path);

private:
    Ui::Widget *ui;
    FileControl * file;
    MediaControl * mediaControl;

    QUdpSocket * receiver;
    QString FTP_host = "192.168.1.100";
    int FTP_port = 2121;
    QString FTP_file = "null";
    QString FTP_path = "/test/";
    QString FTP_userName;
    QString FTP_password;
    //为什么这里可以调用这个变量？
    QTreeWidgetItem * location_list;
    QTreeWidgetItem * FTP_list;

    QSlider * vol;

    QPoint offset;

protected:
    void mousePressEvent(QMouseEvent * event);
    void mouseMoveEvent(QMouseEvent * event);
    void mouseReleaseEvent(QMouseEvent *event);
};

#endif // WIDGET_H
